import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    phone:'',
    pic:6,
    search:'',
    admin:'',
  },
  getters: {
  },
  mutations: {
    getPhone(state,phone){
      state.phone=phone
      sessionStorage.setItem("phone",phone)
    },
    getPic(state,pic){
      state.pic=pic
      sessionStorage.setItem("pic",pic)
    },
    getSearch(state,search){
      state.search=search
    },
    logOut(state){
      sessionStorage.removeItem("phone")
      sessionStorage.removeItem("pic")
      sessionStorage.removeItem("WEB_IM_USER")
      sessionStorage.removeItem("admin")
      window.location.reload()
    }
  },
  actions: {
  },
  modules: {
  }
})
